package com.data.mapper;

import com.data.entity.Database;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface DatabaseMapper extends BaseMapper<Database> {

    //需要把 " 替换为: " 然后删除#'{page}',#'{limit}' 的单引号
    @Select({"<script>" ,
                "SELECT * FROM t_database  ",
                "order by createtime desc limit #{page},#{limit}" ,
            "</script>"})
   List<Database> listPage(@Param("page")Integer page,
                                     @Param("limit")Integer limit);

    @Select({"<script>" ,
            "SELECT count(1) FROM t_database  ",
            "</script>"})
   int count();

}
